﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Collections.Generic;

namespace SPDeveloper.Web.Models
{
    [Bind(Exclude = "ArticleId")]
    public class Article
    {
        [ScaffoldColumn(false)]
        public int ArticleId { get; set; }

        [DisplayName("Genre")]
        public int GenreId { get; set; }
        
        [Required(ErrorMessage = "长度不能超过720个字符")]
        [StringLength(720)]
        public string Title { get; set; }

        public string Content { get; set; }

        [DisplayName("提交时间")]
        public string PostDate { get; set; }

        [DisplayName("更新时间")]
        public string UpdateDate { get; set; }

        [DisplayName("最新回复时间")]
        public string LastCommentDate { get; set; }

        public int Views { get; set; }
        public int Answers { get; set; }
        public int Notes { get; set; }

        public virtual Genre Genre { get; set; }
        public virtual List<Comment> Comment { get; set; }
        public virtual List<Tag> Tag { get; set; }
    }


}